<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div {
            width: 1000px;
            height: 1000px;
            border: 10px solid red;
            background-image: url("../images/img.jpg");
            background-repeat: no-repeat;
            background-attachment: fixed;
            background-position: left top;
        }
    </style>
</head>
<body>
    <!--
    background-attachment背景图片是否滚动
    scoll 跟随滚动条滚动
    fixed 不会跟随滚动条滚动
    -->
    <div></div>
</body>
</html>